package cn.tedu.knows.portal.mapper;

import cn.tedu.knows.portal.model.Question;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

/**
 * <p>
 * Mapper 接口
 * </p>
 *
 * @author tedu.cn
 * @since 2022-01-26
 */
@Repository
public interface QuestionMapper extends BaseMapper<Question> {

    @Select("select count(*) from question where user_id=#{id} " +
            "and delete_status=0")
    int countQuestionsByUserId(Integer id);

    @Select("select count(*) from user_collect where user_id=#{id}")
    int countCollectionsByUserId(Integer id);



}
